<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%String messgae = request.getParameter("message"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Web Directory</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="css/style.css" type="text/css" />
<style>
.top {
	border: 0px solid #ccc;
	overflow: hidden;
	padding: 0;
	margin: 0;
	padding-bottom: 2px;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
}

.top-left {
	border: 0px solid #ccc;
	font: bold 14px Arial, Verdana, Helvetica, sans-serif;
	float: left;
	padding: 5px 0;
}

.top-right {
	border: 0px solid #ccc;
	float: right;
	text-align: right;
}

.details1 {
	overflow: hidden;
}

.content-left {
	float: left;
	padding-right: 20px;
	border: 0px solid #ccc;
}

.content-right {
	float: right;
	border: 0px solid #ccc;
}

.frm .field {
	display: table;
	margin: 5px;
}

.frm div label {
	width: 150px;
	word-wrap: break-word;
	display: table-cell;
	vertical-align: middle;
	position: static;
}

.frm textarea {
	width: 260px;
	height: 80px;
}

.frm input[type="text"],input[type="password"] {
	width: 260px;
}

.lstcbb {
	width: 260px;
	height: 95px;
	overflow-y: auto;
	border: 1px solid #ccc;
	background-color: #fff;
	display: auto;
}

.odd td {
	color: #222;
}
</style>
<script type="text/javascript">
          function get_radio_value() {
            var inputs = document.getElementsByName("r1");
            for (var i = 0; i < inputs.length; i++) {
              if (inputs[i].checked) {
                return i;
              }
            }
            return -1;
          }

          function checkSelect() {
            var id = get_radio_value();
            if(id==-1 ){
            	alert("Ban chua chon dich vu nao de Copy!");
            }else{
            	document.location="copyService.action?index="+id;
            	/* document.location='copyService.action?name='+sv_name; */
            }
          }
        </script>
</head>
<body>
	<%@include file="header.jsp"%>
	<!--End #header-->
	<%
		if(messgae!=null &&messgae.equals("1")){
	%>
		<script type="text/javascript">
			alert("Them dich vu thanh cong");
		</script>
	<%} %>
	<div id="content">
		<div id="mainContainer">
			<div class="box">
				<div id="container-orglst">
					<div id="tab5" class="tabContents details4">
						<h1>Trust Service List</h1>
						<div class="top">
							<div class="top-left filter">
								<a href="#">All</a> | <a href="#">0-9</a> | <a href="#">A</a> <a
									href="#">B</a> <a href="#">C</a> <a href="#">D</a> <a href="#">E</a>
								| <a href="#">F</a> <a href="#">G</a> <a href="#">H</a> <a
									href="#">I</a> <a href="#">J</a> | <a href="#">K</a> <a
									href="#">L</a> <a href="#">M</a> <a href="#">N</a> | <a
									href="#">O</a> <a href="#">P</a> <a href="#">Q</a> <a href="#">R</a>
								| <a href="#">S</a> <a href="#">T</a> <a href="#">U</a> <a
									href="#">V</a> | <a href="#">W</a> <a href="#">X</a> <a
									href="#">Y</a> <a href="#">Z</a>
							</div>
							<div class="top-right include"
								style="width: 270px; display: inline; margin-bottom: 10px; padding: 0">
								<a href="#"><input type="button" value="Copy"
									onclick="checkSelect()" /> </a> <a href="addService.action"><input
									type="button" value="Create" /> </a> <input type="checkbox"
									name="incInActv" id="checkBoxIa" /> <label class="lbcheck"
									for="checkBoxIa">Include Inactive</label>
							</div>
						</div>
						<div class="clear"></div>
						<div class="div-table">
							<div class="table-list">
								<script type="text/javascript">
											function  openDetails(sv_name) {
															document.location='showDetailService.action?sv_name='+sv_name;
												}
											function  showConfirmationAndOpenDetails(sv_name) {
												if (confirm('Do you want to set active for this programme?')) { 
													document.location='activeList.action?sv_name='+sv_name;
												}
										}
									</script>
								<table width="100%" id="table">
									<thead>
										<tr>
											<th></th>
											<th>Service Name</th>
											<th>Description</th>
											<th>Service Type</th>
											<th>Contact</th>
											<th>Is Active ?</th>
										</tr>
									</thead>
									<tbody>

										<s:iterator value="list">
											<tr class="odd ">
												<td><input type="radio" name="r1"></td>
												<td><s:set name="active" value="active" /> <s:set
														name="sv_name" value="sv_name" /> <a href="#"
													onclick="<s:if
										test="%{#active==false}">showConfirmationAndOpenDetails('${sv_name}');</s:if> <s:else>openDetails('${sv_name}');</s:else>">${sv_name}</a>
												</td>
												<td><s:property value="sv_description" /></td>
												<td><s:property value="sv_type" /></td>
												<td><s:property value="contact" /></td>
												<td><s:set name="active" value="active" /> <s:if
														test="%{#active==false}">No</s:if> <s:else>Yes</s:else></td>
											</tr>
										</s:iterator>

									</tbody>
								</table>
							</div>
							<span class="pagelinks"> <a href="#"><img
									src="images/first.png" title="First Page" alt="First Page" />
							</a> <a href="#"><img src="images/prev.png" title="Prev Page"
									alt="Prev Page" /> </a> Page <input
								style="font-size: 12px; width: 35px; padding: 4px;"
								class="curpage" type="text" name="b" value="1" /> of <span
								class="nops">1</span> <a href="#"><img src="images/next.png"
									title="Next Page" alt="Next Page" /> </a> <a href="#"><img
									src="images/last.png" title="Last Page" alt="Last Page" /> </a>
							</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<%@include file="footer.jsp"%>
</body>
</html>